package com.yty.demo._9_enum;

/**
 * @author: yangtaoyao
 * @time: 2020/1/14 16:25
 * @description: 枚举类
 */
public class enumTest {
    public static void main(String[] args) {
        Season season=Season.SPRING;
        System.out.println(season.getName()+","+season.getDesc());
    }
}

enum Season implements IA{
    SPRING("春天","春暖花开"),//实例，相当于调用私有构造函数；
    SUMMER("夏天","炎炎夏日"),
    AUTUMN("秋天","秋风萧萧"),
    WINTER("冬天","大雪纷飞");

    private final String name;
    private final String desc;

    private Season(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public void test() {
        System.out.println("test");
    }
}

interface IA{
    void test();
}
